package com.better517na.elasticseach.elasticsearch.client;



import com.better517na.elasticseach.elasticsearch.AbstractHttpElasticSearchClient;
import com.better517na.elasticseach.elasticsearch.Index;

import java.util.Map;

public class ESHttpClient extends AbstractHttpElasticSearchClient {

    private String host;

    private String port;


    public boolean indexStatus(Index index) {
        Map<String, String> headMsg = head(index);
        if (null != headMsg && "200".equalsIgnoreCase(headMsg.get("Status"))){
            return true;
        }
        return false;
    }

    public ESHttpClient() {
    }

    public ESHttpClient(String host, String port) {
        this.host = host;
        this.port = port;
    }

    public String getHost() {
        return host;
    }

    public String getPort() {
        return port;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public void setPort(String port) {
        this.port = port;
    }
}
